public class Leetcode344 {
    public static void main(String[] args) {
        char[] chars = {'H','a','n','n','a','h'};
        reverseString(chars);
        System.out.println(
                chars
        );
    }

    public static void reverseString(char[] s) {
        int left = 0;
        int right = s.length - 1;
        char c;
        while (left < right) {
            c = s[left];
            s[left] = s[right];
            s[right] = c;
            left++;
            right--;
        }
    }
}
